#include <stdio.h>
#include <netinet/in.h>
#include <netinet/ether.h>
#include <string.h>
#include <mcheck.h>

int main(int argc, char **argv)
{
	
	mtrace(); 
	
	if (argc!=3) {
		printf("I need a device and a mac\n");
		return -1;
	}

	struct in_addr ipfound;
	struct ether_addr mac;

	memcpy(&mac, ether_aton(argv[2]), sizeof(struct ether_addr));
	
	if ( ip_seek(&mac,argv[1],&ipfound) == 0){
		printf("Congratulations: %s\n",inet_ntoa(ipfound));
	}
	else printf("Cagada\n");

	return 0;
	    


}
